<template>
  <div>
    <div>
      <we-button v-if="baseCode" @click="dialogFormVisible = true" type="primary" size="mini">
        <em class="el-icon-plus"></em> 新增
      </we-button>
      <we-button v-if="baseCode" @click="detailRow(currentRow)" type="primary" size="mini">
        <em class="el-icon-edit"></em> 修改
      </we-button>
      <we-button v-if="baseCode" @click="deleteRow"  type="primary" size="mini">
        <em class="el-icon-delete"></em> 删除
      </we-button>
      <span v-if="baseName">当前人员：【 {{baseName}} 】</span>
    </div>

    <!-- 表格 -->
    <el-table
      size="mini"
      :header-cell-style="rowClass"
      :data="tableData"
      height="116px"
      border
      highlight-current-row
      resizable
      ref="singleTable"
      @row-dblclick="detailRow"
      @current-change="handleCurrentChange"
      style="width: 100%; margin-top: 5px"
    >
      <el-table-column type="index" fixed label="#"> </el-table-column>
      <el-table-column
        prop="salaryDate"
        width="150"
        :show-overflow-tooltip="true"
        label="年月标识"
      >
      </el-table-column>
      <el-table-column
        prop="salaryType_dictText"
        width="150"
        :show-overflow-tooltip="true"
        label="工资标准类别"
      >
      </el-table-column>
      <el-table-column
        prop="publicServerSum"
        width="150"
        :show-overflow-tooltip="true"
        label="公务员工资合计"
      >
      </el-table-column>
      <el-table-column
        prop="publicServerBaseSal"
        :show-overflow-tooltip="true"
        width="150"
        label="公务员基本工资小计"
      >
      </el-table-column>
      <el-table-column
        prop="publicServerPositionAmount"
        :show-overflow-tooltip="true"
        width="150"
        label="公务员职务工资"
      >
      </el-table-column>
      <el-table-column
        prop="publicServerSalaryLevel_dictText"
        :show-overflow-tooltip="true"
        width="150"
        label="公务员工资级别"
      >
      </el-table-column>
      <el-table-column
        prop="publicServerSalaryGrade_dictText"
        :show-overflow-tooltip="true"
        width="150"
        label="公务员级别工资档次"
      >
      </el-table-column>
      <el-table-column
        prop="publicServerGradeSal"
        :show-overflow-tooltip="true"
        width="150"
        label="公务员级别工资"
      >
      </el-table-column>
      <el-table-column
        prop="publicServerExtraEarn"
        :show-overflow-tooltip="true"
        width="150"
        label="公务员津补贴小计"
      >
      </el-table-column>
      <el-table-column
        prop="departmentServerSal"
        :show-overflow-tooltip="true"
        width="150"
        label="机关工人工资合计"
      >
      </el-table-column>
      <el-table-column
        prop="departmentServerBaseSal"
        :show-overflow-tooltip="true"
        width="150"
        label="机关工人基本工资小计"
      >
      </el-table-column>
      <el-table-column
        prop="departmentServerGradeSal"
        :show-overflow-tooltip="true"
        width="150"
        label="机关工人技术等级(职务)工资"
      >
      </el-table-column>
      <el-table-column
        prop="departmentServerPositionGrade_dictText"
        :show-overflow-tooltip="true"
        width="150"
        label="机关工人岗位工资档次"
      >
      </el-table-column>
      <el-table-column
        prop="departmentServerPositionSal"
        :show-overflow-tooltip="true"
        width="150"
        label="机关工人岗位工资"
      >
      </el-table-column>
      <el-table-column
        prop="departmentServerLevel_dictText"
        :show-overflow-tooltip="true"
        width="150"
        label="机关工人技术等级"
      >
      </el-table-column>
      <el-table-column
        prop="departmentServerExtraSal"
        :show-overflow-tooltip="true"
        width="150"
        label="机关工人津补贴小计"
      >
      </el-table-column>
      <el-table-column
        prop="departmentServerGovSal"
        :show-overflow-tooltip="true"
        width="150"
        label="机关单位国家统一的津补贴"
      >
      </el-table-column>
      <el-table-column
        prop="departmentStandardsSal"
        :show-overflow-tooltip="true"
        width="150"
        label="机关单位规范后津贴补贴"
      >
      </el-table-column>
      <el-table-column
        prop="departmentDevSal"
        :show-overflow-tooltip="true"
        width="150"
        label="机关单位改革性补贴"
      >
      </el-table-column>
      <el-table-column
        prop="departmentYearSal"
        :show-overflow-tooltip="true"
        width="150"
        label="机关单位年终一次性奖金"
      >
      </el-table-column>
      <el-table-column
        prop="departmentReward"
        :show-overflow-tooltip="true"
        width="150"
        label="机关单位奖励性补贴"
      >
      </el-table-column>
      <el-table-column
        prop="departmentOtherSal"
        :show-overflow-tooltip="true"
        width="150"
        label="机关单位其他津补贴"
      >
      </el-table-column>
      <el-table-column
        prop="institutionManagerSum"
        :show-overflow-tooltip="true"
        width="150"
        label="事业单位管理岗工资合计"
      >
      </el-table-column>
      <el-table-column
        prop="institutionManagerLevel_dictText"
        :show-overflow-tooltip="true"
        width="150"
        label="事业管理岗等级"
      >
      </el-table-column>
      <el-table-column
        prop="institutionManagerBaseSal"
        :show-overflow-tooltip="true"
        width="150"
        label="事业管理岗基本工资小计"
      >
      </el-table-column>
      <el-table-column
        prop="institutionManagerSal"
        :show-overflow-tooltip="true"
        width="150"
        label="事业管理岗薪级工资"
      >
      </el-table-column>
      <el-table-column
        prop="institutionManagerPositionSal"
        :show-overflow-tooltip="true"
        width="150"
        label="事业管理岗岗位工资"
      >
      </el-table-column>
      <el-table-column
        prop="institutionManagerGrade_dictText"
        :show-overflow-tooltip="true"
        width="150"
        label="事业管理岗薪级"
      >
      </el-table-column>
      <el-table-column
        prop="institutionTechnologyLevel_dictText"
        :show-overflow-tooltip="true"
        width="150"
        label="事业专业技术岗等级"
      >
      </el-table-column>
      <el-table-column
        prop="institutionTechnologySum"
        :show-overflow-tooltip="true"
        width="150"
        label="事业专业技术岗工资合计"
      >
      </el-table-column>
      <el-table-column
        prop="institutionTechnologyLevelSal"
        :show-overflow-tooltip="true"
        width="150"
        label="事业专技岗基本工资小计"
      >
      </el-table-column>
      <el-table-column
        prop="institutionTechnologyGradeSal"
        :show-overflow-tooltip="true"
        width="150"
        label="事业专业技术岗薪级工资"
      >
      </el-table-column>
      <el-table-column
        prop="institutionTechnologySal"
        :show-overflow-tooltip="true"
        width="150"
        label="事业专业技术岗工资"
      >
      </el-table-column>
      <el-table-column
        prop="institutionTechnologyGrade_dictText"
        :show-overflow-tooltip="true"
        width="150"
        label="事业专业技术岗薪级"
      >
      </el-table-column>
      <el-table-column
        prop="institutionWorkLevel_dictText"
        :show-overflow-tooltip="true"
        width="150"
        label="事业工勤岗等级"
      >
      </el-table-column>
      <el-table-column
        prop="institutionWorkSum"
        :show-overflow-tooltip="true"
        width="150"
        label="事业工勤岗工资合计"
      >
      </el-table-column>
      <el-table-column
        prop="institutionWorkLevelSal"
        :show-overflow-tooltip="true"
        width="150"
        label="事业工勤岗薪级工资"
      >
      </el-table-column>
      <el-table-column
        prop="institutionWorkGradeSal"
        :show-overflow-tooltip="true"
        width="150"
        label="事业工勤岗岗位工资"
      >
      </el-table-column>
      <el-table-column
        prop="institutionWorkBaseSal"
        :show-overflow-tooltip="true"
        width="150"
        label="事业工勤岗基本工资小计"
      >
      </el-table-column>
      <el-table-column
        prop="institutionPerformanceSal"
        :show-overflow-tooltip="true"
        width="150"
        label="事业单位绩效工资"
      >
      </el-table-column>
      <el-table-column
        prop="institutionGovSal"
        :show-overflow-tooltip="true"
        width="150"
        label="事业单位国家统一津贴"
      >
      </el-table-column>
      <el-table-column
        prop="institutionWorkGrade_dictText"
        :show-overflow-tooltip="true"
        width="150"
        label="事业工勤岗薪级"
      >
      </el-table-column>
      <el-table-column
        prop="institutionOthersSal"
        :show-overflow-tooltip="true"
        width="150"
        label="事业单位其他津补贴"
      >
      </el-table-column>
      <el-table-column
        prop="institutionExtraSum"
        :show-overflow-tooltip="true"
        width="150"
        label="事业单位津补补贴合计"
      >
      </el-table-column>
      <el-table-column
        prop="institutionYearSal"
        :show-overflow-tooltip="true"
        width="150"
        label="事业单位年终一次性奖金"
      >
      </el-table-column>
      <el-table-column
        prop="enterpriseSalarySum"
        :show-overflow-tooltip="true"
        width="150"
        label="企业单位工资合计"
      >
      </el-table-column>
      <el-table-column
        prop="enterpriseBaseSal"
        :show-overflow-tooltip="true"
        width="150"
        label="企业单位基本工资"
      >
      </el-table-column>
      <el-table-column
        prop="enterpriseSalaryExtra"
        :show-overflow-tooltip="true"
        width="150"
        label="企业单位工资性津补贴"
      >
      </el-table-column>
      <el-table-column
        prop="enterpriseOtherSal"
        :show-overflow-tooltip="true"
        width="150"
        label="企业单位其他工资"
      >
      </el-table-column>
      <el-table-column
        prop="enterprisePerformanceSal"
        :show-overflow-tooltip="true"
        width="150"
        label="企业单位绩效工资"
      >
      </el-table-column>
      <el-table-column
        prop="skilledSal"
        :show-overflow-tooltip="true"
        width="150"
        label="学徒期、熟练期工资"
      >
      </el-table-column>
      <el-table-column
        prop="practiceSal"
        :show-overflow-tooltip="true"
        width="150"
        label="试用(见习)期工资"
      >
      </el-table-column>
      <el-table-column
        prop="remark"
        :show-overflow-tooltip="true"
        width="150"
        label="备注"
      >
      </el-table-column>
      <!-- <el-table-column fixed="right" label="操作" width="180">
        <template slot-scope="scope">
          <we-button @click="detailRow(scope.row)" type="primary" size="mini"
            >详情</we-button
          >
          <we-button type="danger" @click="deleteRow(scope.row)" size="mini">删除</we-button>
        </template>
      </el-table-column> -->
    </el-table>
    <div class="table_tools">
      <we-pagination
        :total="pagination.total"
        :page="pagination.pageNum"
        :pageSize="pagination.pageSize"
        @currentChange="currentChange($event)"></we-pagination>
    </div>
    <!-- 表格 -->

    <!-- 新增弹窗 -->
    <el-dialog
      title="工资子集"
      :visible.sync="dialogFormVisible"
      @close="handleOffDialog"
      width="80%"
      top="5vh"
      append-to-body
    >
      <el-form :model="ruleForm" label-width="190px" size="mini" :rules="rules" ref="ruleForm">
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="年月标识" prop="salaryDate">
              <el-date-picker
                style="width: 80%"
                v-model="ruleForm.salaryDate"
                type="date"
                placeholder="选择日期"
                value-format="yyyy-MM-dd"
                format="yyyy-MM-dd"
              >
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="工资标准类别" prop="salaryType">
              <el-cascader
                class="inputW"
                v-model="ruleForm.salaryType"
                :options="salaryType"
                :props="{ expandTrigger: 'hover' ,value:'uuid',label:'name',children: 'children'}"
                @change="handleChange"
                clearable
              ></el-cascader>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="公务员工资合计" prop="publicServerSum">
              <el-input
                class="inputW"
                v-model="ruleForm.publicServerSum"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="公务员基本工资小计" prop="publicServerBaseSal">
              <el-input
                class="inputW"
                v-model="ruleForm.publicServerBaseSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="公务员职务工资" prop="publicServerPositionAmount">
              <el-input
                class="inputW"
                v-model="ruleForm.publicServerPositionAmount"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="公务员工资级别" prop="publicServerSalaryLevel">
              <el-select
                class="inputW"
                v-model="ruleForm.publicServerSalaryLevel"
                placeholder="请选择"
                clearable
              >
                <el-option v-for="item in publicServerSalaryLevel" :key="item.uuid" :label="item.name" :value="item.uuid"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="公务员级别工资档次" prop="publicServerSalaryGrade">
              <el-select
                class="inputW"
                v-model="ruleForm.publicServerSalaryGrade"
                placeholder="请选择"
                clearable
              >
                <el-option v-for="item in publicServerSalaryGrade" :key="item.uuid" :label="item.name" :value="item.uuid"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="公务员级别工资" prop="publicServerGradeSal">
              <el-input
                class="inputW"
                v-model="ruleForm.publicServerGradeSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="公务员津补贴小计" prop="publicServerExtraEarn">
              <el-input
                class="inputW"
                v-model="ruleForm.publicServerExtraEarn"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="机关工人工资合计" prop="departmentServerSal">
              <el-input
                class="inputW"
                v-model="ruleForm.departmentServerSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="机关工人基本工资小计" prop="departmentServerBaseSal">
              <el-input
                class="inputW"
                v-model="ruleForm.departmentServerBaseSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="机关工人技术等级(职务)工资" prop="departmentServerGradeSal">
              <el-input
                class="inputW"
                v-model="ruleForm.departmentServerGradeSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="机关工人岗位工资档次" prop="departmentServerPositionGrade">
              <el-select
                class="inputW"
                v-model="ruleForm.departmentServerPositionGrade"
                placeholder="请选择"
                clearable
              >
                <el-option v-for="item in departmentServerPositionGrade" :key="item.uuid" :label="item.name" :value="item.uuid"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="机关工人岗位工资" prop="departmentServerPositionSal">
              <el-input
                class="inputW"
                v-model="ruleForm.departmentServerPositionSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="机关工人技术等级" prop="departmentServerLevel">
              <el-select
                class="inputW"
                v-model="ruleForm.departmentServerLevel"
                placeholder="请选择"
                clearable
              >
                <el-option v-for="item in departmentServerLevel" :key="item.uuid" :label="item.name" :value="item.uuid"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="机关工人津补贴小计" prop="departmentServerExtraSal">
              <el-input
                class="inputW"
                v-model="ruleForm.departmentServerExtraSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="机关单位国家统一的津补贴" prop="departmentServerGovSal">
              <el-input
                class="inputW"
                v-model="ruleForm.departmentServerGovSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="机关单位规范后津贴补贴" prop="departmentStandardsSal">
              <el-input
                class="inputW"
                v-model="ruleForm.departmentStandardsSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="机关单位改革性补贴" prop="departmentDevSal">
              <el-input
                class="inputW"
                v-model="ruleForm.departmentDevSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="机关单位年终一次性奖金" prop="departmentYearSal">
              <el-input
                class="inputW"
                v-model="ruleForm.departmentYearSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="机关单位奖励性补贴" prop="departmentReward">
              <el-input
                class="inputW"
                v-model="ruleForm.departmentReward"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="机关单位其他津补贴" prop="departmentOtherSal">
              <el-input
                class="inputW"
                v-model="ruleForm.departmentOtherSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="事业单位管理岗工资合计" prop="institutionManagerSum">
              <el-input
                class="inputW"
                v-model="ruleForm.institutionManagerSum"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="事业管理岗等级" prop="institutionManagerLevel">
              <el-select
                class="inputW"
                v-model="ruleForm.institutionManagerLevel"
                placeholder="请选择"
                clearable
              >
                <el-option v-for="item in institutionManagerLevel" :key="item.uuid" :label="item.name" :value="item.uuid"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="事业管理岗基本工资小计" prop="institutionManagerBaseSal">
              <el-input
                class="inputW"
                v-model="ruleForm.institutionManagerBaseSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="事业管理岗薪级工资" prop="institutionManagerSal">
              <el-input
                class="inputW"
                v-model="ruleForm.institutionManagerSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="事业管理岗岗位工资" prop="institutionManagerPositionSal">
              <el-input
                class="inputW"
                v-model="ruleForm.institutionManagerPositionSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="事业管理岗薪级" prop="institutionManagerGrade">
              <el-select
                class="inputW"
                v-model="ruleForm.institutionManagerGrade"
                placeholder="请选择"
                clearable
              >
                <el-option v-for="item in institutionManagerGrade" :key="item.uuid" :label="item.name" :value="item.uuid"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="事业专业技术岗等级" prop="institutionTechnologyLevel">
              <el-select
                class="inputW"
                v-model="ruleForm.institutionTechnologyLevel"
                placeholder="请选择"
                clearable
              >
                <el-option v-for="item in institutionTechnologyLevel" :key="item.uuid" :label="item.name" :value="item.uuid"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="事业专业技术岗工资合计" prop="institutionTechnologySum">
              <el-input
                class="inputW"
                v-model="ruleForm.institutionTechnologySum"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="事业专技岗基本工资小计" prop="institutionTechnologyLevelSal">
              <el-input
                class="inputW"
                v-model="ruleForm.institutionTechnologyLevelSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="事业专业技术岗薪级工资" prop="institutionTechnologyGradeSal">
              <el-input
                class="inputW"
                v-model="ruleForm.institutionTechnologyGradeSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="事业专业技术岗工资" prop="institutionTechnologySal">
              <el-input
                class="inputW"
                v-model="ruleForm.institutionTechnologySal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="事业专业技术岗薪级" prop="institutionTechnologyGrade">
              <el-select
                class="inputW"
                v-model="ruleForm.institutionTechnologyGrade"
                placeholder="请选择"
                clearable
              >
                <el-option v-for="item in institutionTechnologyGrade" :key="item.uuid" :label="item.name" :value="item.uuid"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="事业工勤岗等级" prop="institutionWorkLevel">
              <el-select
                class="inputW"
                v-model="ruleForm.institutionWorkLevel"
                placeholder="请选择"
                clearable
              >
                <el-option v-for="item in institutionWorkLevel" :key="item.uuid" :label="item.name" :value="item.uuid"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="事业工勤岗工资合计" prop="institutionWorkSum">
              <el-input
                class="inputW"
                v-model="ruleForm.institutionWorkSum"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="事业工勤岗薪级工资" prop="institutionWorkLevelSal">
              <el-input
                class="inputW"
                v-model="ruleForm.institutionWorkLevelSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="事业工勤岗岗位工资" prop="institutionWorkGradeSal">
              <el-input
                class="inputW"
                v-model="ruleForm.institutionWorkGradeSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="事业工勤岗基本工资小计" prop="institutionWorkBaseSal">
              <el-input
                class="inputW"
                v-model="ruleForm.institutionWorkBaseSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="事业单位绩效工资" prop="institutionPerformanceSal">
              <el-input
                class="inputW"
                v-model="ruleForm.institutionPerformanceSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="事业单位国家统一津贴" prop="institutionGovSal">
              <el-input
                class="inputW"
                v-model="ruleForm.institutionGovSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="事业工勤岗薪级" prop="institutionWorkGrade">
              <el-select
                class="inputW"
                v-model="ruleForm.institutionWorkGrade"
                placeholder="请选择"
                clearable
              >
                <el-option v-for="item in institutionWorkGrade" :key="item.uuid" :label="item.name" :value="item.uuid"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="事业单位其他津补贴" prop="institutionOthersSal">
              <el-input
                class="inputW"
                v-model="ruleForm.institutionOthersSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="事业单位津补补贴合计" prop="institutionExtraSum">
              <el-input
                class="inputW"
                v-model="ruleForm.institutionExtraSum"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="事业单位年终一次性奖金" prop="institutionYearSal">
              <el-input
                class="inputW"
                v-model="ruleForm.institutionYearSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="企业单位工资合计" prop="enterpriseSalarySum">
              <el-input
                class="inputW"
                v-model="ruleForm.enterpriseSalarySum"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="企业单位基本工资" prop="enterpriseBaseSal">
              <el-input
                class="inputW"
                v-model="ruleForm.enterpriseBaseSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="企业单位工资性津补贴" prop="enterpriseSalaryExtra">
              <el-input
                class="inputW"
                v-model="ruleForm.enterpriseSalaryExtra"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="企业单位其他工资" prop="enterpriseOtherSal">
              <el-input
                class="inputW"
                v-model="ruleForm.enterpriseOtherSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="企业单位绩效工资" prop="enterprisePerformanceSal">
              <el-input
                class="inputW"
                v-model="ruleForm.enterprisePerformanceSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="学徒期、熟练期工资" prop="skilledSal">
              <el-input
                class="inputW"
                v-model="ruleForm.skilledSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <el-form-item label="试用(见习)期工资" prop="practiceSal">
              <el-input
                class="inputW"
                v-model="ruleForm.practiceSal"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="16">
            <el-form-item label="备注情况" prop="remark">
              <el-input
                style="width: 85%"
                type="textarea"
                v-model="ruleForm.remark"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <we-button size="mini" @click="handleOffDialog"
          >取 消</we-button
        >
        <we-button v-if="!isUpdate" size="mini" type="primary"  @click="submitForm('ruleForm')"
          >新 增</we-button
        >
        <we-button v-if="isUpdate" size="mini" type="primary" @click="updateForm('ruleForm')"
          >修 改</we-button
        >
      </div>
    </el-dialog>
    <!-- 新增弹窗 -->
  </div>
</template>

<script>
import WeButton from '@/components/WeButton'
import WePagination from '@/components/WePagination'
import { parseTree } from '@/utils/util'
import {deleteAction, getAction, postAction} from '@/api/manage'
import {bus} from "@/utils/eventBus";
import {opDictNew} from "@/api/apiUrl";
export default {
  components: {
    WeButton,
    WePagination
  },
  data () {
    return {
      isUpdate: false,
      pagination: {
        total: 10, // 总数据条数
        pageSize: 10, // 每页条数
        pageNum: 1 // 当前页
      }, // 列表分页数据
      tableData: [],
      dialogFormVisible: false,
      currentRow: null,
      ruleForm: {
        salaryDate: '',
        salaryType: '',
        publicServerSum: '',
        publicServerBaseSal: '',
        publicServerPositionAmount: '',
        publicServerSalaryLevel: '',
        publicServerSalaryGrade: '',
        publicServerGradeSal: '',
        publicServerExtraEarn: '',
        departmentServerSal: '',
        departmentServerBaseSal: '',
        departmentServerGradeSal: '',
        departmentServerPositionGrade: '',
        departmentServerPositionSal: '',
        departmentServerLevel: '',
        departmentServerExtraSal: '',
        departmentServerGovSal: '',
        departmentStandardsSal: '',
        departmentDevSal: '',
        departmentYearSal: '',
        departmentReward: '',
        departmentOtherSal: '',
        institutionManagerSum: '',
        institutionManagerLevel: '',
        institutionManagerBaseSal: '',
        institutionManagerSal: '',
        institutionManagerPositionSal: '',
        institutionManagerGrade: '',
        institutionTechnologyLevel: '',
        institutionTechnologySum: '',
        institutionTechnologyLevelSal: '',
        institutionTechnologyGradeSal: '',
        institutionTechnologySal: '',
        institutionTechnologyGrade: '',
        institutionWorkLevel: '',
        institutionWorkSum: '',
        institutionWorkLevelSal: '',
        institutionWorkBaseSal: '',
        institutionWorkGradeSal: '',
        institutionPerformanceSal: '',
        institutionGovSal: '',
        institutionWorkGrade: '',
        institutionExtraSum: '',
        enterpriseSalarySum: '',
        enterpriseBaseSal: '',
        enterpriseSalaryExtra: '',
        enterpriseOtherSal: '',
        skilledSal: '',
        practiceSal: '',
        institutionYearSal: '',
        enterprisePerformanceSal: '',
        institutionOthersSal: '',
        uuidList:[],
      },
      rules: {
        publicServerSum: [
          { required: true, message: '请填写公务员工资合计', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        publicServerBaseSal: [
          { required: true, message: '请填写公务员工资合计', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        publicServerPositionAmount: [
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        publicServerGradeSal: [
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        publicServerExtraEarn: [
          { required: true, message: '请填写公务员津补贴小计', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        departmentServerSal: [
          { required: true, message: '请填写机关工人工资合计', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        departmentServerBaseSal: [
          { required: true, message: '请填写机关工人基本工资小计', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        departmentServerGradeSal: [
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        institutionYearSal: [
          { required: true, message: '请填写事业单位年终一次性奖金', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        departmentServerPositionSal: [
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        departmentServerExtraSal: [
          { required: true, message: '请填写机关工人津补贴小计', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        departmentServerGovSal: [
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        departmentStandardsSal: [
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        departmentDevSal: [
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        departmentYearSal: [
          { required: true, message: '请填写机关单位年终一次性奖金', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        departmentReward: [
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        departmentOtherSal: [
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        institutionManagerSal: [
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        institutionManagerSum: [
          { required: true, message: '请填写事业单位管理岗工资合计', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        institutionManagerBaseSal: [
          { required: true, message: '请填写事业管理岗基本工资小计', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        institutionManagerPositionSal: [
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        institutionTechnologySum: [
          { required: true, message: '请填写事业专业技术岗工资合计', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        institutionTechnologyLevelSal: [
          { required: true, message: '请填写事业专技岗基本工资小计', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        institutionTechnologyGradeSal: [
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        institutionTechnologySal: [
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        institutionWorkSum: [
          { required: true, message: '请填写事业工勤岗工资合计', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        institutionWorkLevelSal: [
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        institutionWorkBaseSal: [
          { required: true, message: '请填写事业工勤岗基本工资小计', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        institutionWorkGradeSal: [
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        institutionPerformanceSal: [
          { required: true, message: '请填写事业单位绩效工资', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        institutionGovSal: [
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        institutionExtraSum: [
          { required: true, message: '请填写事业单位津补补贴合计', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        enterpriseSalarySum: [
          { required: true, message: '请填写企业单位工资合计', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        enterpriseBaseSal: [
          { required: true, message: '请填写企业单位基本工资', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        enterpriseSalaryExtra: [
          { required: true, message: '请填写企业单位工资性津补贴', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        enterpriseOtherSal: [
          { required: true, message: '请填写企业单位其他工资', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        skilledSal: [
          { required: true, message: '请填写学徒期、熟练期工资', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        practiceSal: [
          { required: true, message: '请填写试用(见习)期工资', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        enterprisePerformanceSal: [
          { required: true, message: '请填写企业单位绩效工资', trigger: 'blur' },
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ],
        institutionOthersSal: [
          {
            pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
            message: '请输入数字(可保留两位小数)'
          }
        ]
      },

      salaryType: [],
      publicServerSalaryLevel: [],
      publicServerSalaryGrade: [],
      departmentServerPositionGrade: [],
      departmentServerLevel: [],
      institutionManagerLevel: [],
      institutionManagerGrade: [],
      institutionTechnologyLevel: [],
      institutionWorkLevel: [],
      institutionWorkGrade: [],
      institutionTechnologyGrade: [],
      baseCode: '',
      baseName: '',
    }
  },
  watch: {
    dialogFormVisible () {
      if (this.dialogFormVisible === false) {
        if (this.isUpdate) {
          setTimeout(() => {
            this.isUpdate = false
            this.clearForm()
            if (this.$refs.ruleForm !== undefined) {
              this.$refs.ruleForm.resetFields()
            }
          }, 500)
        }
        if (this.$store.state.wage === true) {
          this.$store.commit('changeWage', false)
        }
      }
    },
    '$store.state.baseCode'(newval) {
      this.baseCode  = newval
      this.getList()
    },
    '$store.state.baseName'(newval) {
      this.baseName  = newval
    },
    '$store.state.wage' (newval) {
      if (newval === true) {
        this.dialogFormVisible = true
        if (this.$store.state.updateSubset === true) {
          this.isUpdate = true
        } else {
          this.isUpdate = false
        }
        this.$store.commit('changeUpdateSubset', false)
        this.baseCodes = this.$store.state.baseCodes
        this.getSalaryType()
        this.getPublicServerSalaryLevel()
        this.getPublicServerSalaryGrade()
        this.getDepartmentServerPositionGrade()
        this.getDepartmentServerLevel()
        this.getInstitutionManagerLevel()
        this.getInstitutionManagerGrade()
        this.getInstitutionTechnologyLevel()
        this.getInstitutionWorkLevel()
        this.getInstitutionWorkGrade()
      }
    }
  },
  methods: {
    clickSubset () {
      this.baseCode = this.$store.state.baseCode
      this.getList()
      this.getSalaryType()
      this.getPublicServerSalaryLevel()
      this.getPublicServerSalaryGrade()
      this.getDepartmentServerPositionGrade()
      this.getDepartmentServerLevel()
      this.getInstitutionManagerLevel()
      this.getInstitutionManagerGrade()
      this.getInstitutionTechnologyLevel()
      this.getInstitutionWorkLevel()
      this.getInstitutionWorkGrade()
    },
    batchAdd(data){
      this.dialogFormVisible = true
      this.ruleForm.uuidList = data
    },
    /*
     * 新增
     */
    submitForm (formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          const data = JSON.parse(JSON.stringify(this.ruleForm))
          if (data.salaryType) {
            data.salaryType = data.salaryType.pop()
          }
          data.baseCode = this.baseCode
          data.sysOrgCode = '测试部门'
          data.createUser = '测试员'
          if (this.$store.state.wage === true) {
            for (let i = 0; i < this.baseCodes.length; i++) {
              data.baseCode = this.baseCodes[i]
              postAction('/opSalary/add', data)
                .then(result => {
                  if (result.code === 200) {
                    this.dialogFormVisible = false
                    bus.$emit('handleDialog')
                    this.$message({
                      type: 'success',
                      message: '新增成功!'
                    })
                    this.clearForm()
                  } else {
                    this.$message({
                      type: 'waring',
                      message: result.msg
                    })
                  }
                })
            }
          } else {
            postAction('/opSalary/add', data)
              .then(result => {
                if (result.code === 200) {
                  this.dialogFormVisible = false
                  bus.$emit('handleDialog')
                  this.getList()
                  this.$message({
                    type: 'success',
                    message: '新增成功!'
                  })
                } else {
                  this.$message({
                    type: 'waring',
                    message: result.msg
                  })
                }
              })
          }
        } else {
          return false
        }
      })
    },
    handleCurrentChange(val) {
        this.currentRow = val;
    },
    /**
     * 删除
     */
    deleteRow (row) {
      if(!this.currentRow){
        this.$message("请选择要删除的数据！")
        return
      }
      this.$confirm('是否要删除这条数据?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(() => {
          deleteAction('/opSalary/delete', { uuids: [this.currentRow.uuid ]})
            .then((res) => {
              if (res.code === 200) {
                this.getList()
                this.$message({
                  type: 'success',
                  message: '删除成功!'
                })
              } else {
                this.$message({
                  type: 'waring',
                  message: res.msg
                })
              }
            })
        })
        .catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          })
        })
    },

    /**
     * 修改
     */
    updateForm (formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          const data = JSON.parse(JSON.stringify(this.ruleForm))
          if (typeof (this.ruleForm.salaryType) !== 'string') {
            data.salaryType = data.salaryType.pop()
          }
          data.updateUser = '修改员'
          postAction('/opSalary/update', data)
            .then(result => {
              if (result.code === 200) {
                this.dialogFormVisible = false
                bus.$emit('handleDialog')
                this.getList()
                this.$message({
                  type: 'success',
                  message: '修改成功!'
                })
              } else {
                this.$message({
                  type: 'waring',
                  message: result.msg
                })
              }
            })
        } else {
          return false
        }
      })
    },
    handleOffDialog() {
      this.dialogFormVisible = false
      bus.$emit('handleDialog')
    },
    /**
     * 查询
     */
    getList () {
      let self = this
      postAction('/opSalary/opSalarySearch', { baseCode: this.baseCode,size:this.pagination.pageSize, page:this.pagination.pageNum })
        .then((res) => {
          if (res.code === 200) {
            if (!res.data.list.length && self.pagination.pageNum !== 1) {
              self.pagination.pageNum -= 1
              self.getList()
              return
            }
            if (self.pagination.pageNum === 1 && res.data.list.length === 0) {
              self.pagination.total = 0
            } else {
              self.pagination.total = res.data.total
            }
            self.tableData = res.data.list
          }
        })
    },

    /**
     * 工资标准类别
     */
    getSalaryType () {
       getAction(`${opDictNew.findTreeByType}?type=rs_gzlb`).then((result) => {
        if (result.code === 200) {
          this.salaryType = result.data
        }
      })
    },

    /*
     * 获取公务员工资级别字典
     */
    async getPublicServerSalaryLevel () {
      const result = await getAction(`${opDictNew.findByType}?type=rs_gwygzjb`)
      this.publicServerSalaryLevel = result.data
    },

    /*
     * 获取公务员级别工资档次字典
     */
    async getPublicServerSalaryGrade () {
      const result = await getAction(`${opDictNew.findByType}?type=rs_gwygzdc`)
      this.publicServerSalaryGrade = result.data
    },

    /*
     * 获取机关工人岗位工资档次字典
     */
    async getDepartmentServerPositionGrade () {
      const result = await getAction(`${opDictNew.findByType}?type=rs_ggrgwgzdc`)
      this.departmentServerPositionGrade = result.data
    },

    /*
     * 获取机关工人技术等级字典
     */
    async getDepartmentServerLevel () {
      const result = await getAction(`${opDictNew.findByType}?type=rs_jgjsgrjsdj`)
      this.departmentServerLevel = result.data
    },

    /*
     * 获取事业单位管理岗等级字典
     */
    async getInstitutionManagerLevel () {
      const result = await getAction(`${opDictNew.findByType}?type=rs_jggwjb`)
      this.institutionManagerLevel = result.data
    },

    /*
     * 获取事业单位管理岗薪级字典
     * 获取事业单位专业薪级
     */
    async getInstitutionManagerGrade () {
      const result = await getAction(`${opDictNew.findByType}?type=rs_xj`)
      this.institutionTechnologyGrade = result.data
      this.institutionManagerGrade = result.data
    },

    /*
     * 获取事业单位专业技术岗等级字典
     */
    async getInstitutionTechnologyLevel () {
      const result = await getAction(`${opDictNew.findByType}?type=rs_gqgwjb`)
      this.institutionTechnologyLevel = result.data
       this.institutionWorkLevel = result.data
    },

    /*
     * 获取事业单位专业技术岗等级字典
     */
    async getInstitutionWorkLevel () {
      // const result = await getAction(opCorePropertyValue.newGetPropertyList, {
      //   value: 'enterprise_worker_level'
      // })
      // this.institutionWorkLevel = result.data.list
    },

    /*
     * 获取事业单位专业技术岗等级字典
     */
    async getInstitutionWorkGrade () {
      const result = await getAction(`${opDictNew.findByType}?type=rs_gqxj`)
      this.institutionWorkGrade = result.data
    },

    /**
     * 详情
     */
    detailRow (row) {
      if(!row){
        this.$message("请选择要编辑的数据！")
        return
      }
      this.ruleForm = JSON.parse(JSON.stringify(row))
      this.isUpdate = true
      this.dialogFormVisible = true
    },

    // 当前页改变
    currentChange (event) {
      this.pagination.pageNum = event
      this.getList()
    },

    /**
     * 清除form
     */
    clearForm () {
      this.ruleForm = {
        salaryDate: '',
        salaryType: '',
        publicServerSum: '',
        publicServerBaseSal: '',
        publicServerPositionAmount: '',
        publicServerSalaryLevel: '',
        publicServerSalaryGrade: '',
        publicServerGradeSal: '',
        publicServerExtraEarn: '',
        departmentServerSal: '',
        departmentServerBaseSal: '',
        departmentServerGradeSal: '',
        departmentServerPositionGrade: '',
        departmentServerPositionSal: '',
        departmentServerLevel: '',
        departmentServerExtraSal: '',
        departmentServerGovSal: '',
        departmentStandardsSal: '',
        departmentDevSal: '',
        departmentYearSal: '',
        departmentReward: '',
        departmentOtherSal: '',
        institutionManagerSum: '',
        institutionManagerLevel: '',
        institutionManagerBaseSal: '',
        institutionManagerSal: '',
        institutionManagerPositionSal: '',
        institutionManagerGrade: '',
        institutionTechnologyLevel: '',
        institutionTechnologySum: '',
        institutionTechnologyLevelSal: '',
        institutionTechnologyGradeSal: '',
        institutionTechnologySal: '',
        institutionTechnologyGrade: '',
        institutionWorkLevel: '',
        institutionWorkSum: '',
        institutionWorkLevelSal: '',
        institutionWorkBaseSal: '',
        institutionWorkGradeSal: '',
        institutionPerformanceSal: '',
        institutionGovSal: '',
        institutionWorkGrade: '',
        institutionExtraSum: '',
        enterpriseSalarySum: '',
        enterpriseBaseSal: '',
        enterpriseSalaryExtra: '',
        enterpriseOtherSal: '',
        skilledSal: '',
        practiceSal: '',
        institutionYearSal: '',
        enterprisePerformanceSal: '',
        institutionOthersSal: ''
      }
    },

    rowClass ({ row, rowIndex }) {
      return 'background:rgba(248, 248, 249, 1);color:#000;'
    },
    handleChange () {},
    handleClose () {}
  }
}
</script>

<style scoped>
.inputW {
  width: 80%;
}
.table_tools {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}
</style>
